$(function () {

  $.ajax({
      url: "/webapi/student/list",
      type:"GET",
      success:function (data) {
          var html="";
          for(var i=0; i<data.length;i++){
              var sex="";
              var item = data[i];
              html+="<tr id='" + i + "'>";

              html+="<td>"+item.id + "</td>>";
              html+="<td>"+item.no + "</td>>";
              html+="<td class='studentName'>"+item.name + "</td>>";
              html+="<td>"+item.password + "</td>>";
              if (item.sex === 1){
                  sex = "男";
              }
              else if (item.sex === 2){
                  sex = "女";
              }
              else{
                  sex = "未知";
              }
              html+="<td>"+sex + "</td>>";
              html+="<td>"+item.age + "</td>>";
              html+="<td>"+item.score + "</td>>";

              html+="</tr>";
          }
          $("#students").html(html);
          console.log(data);
      }
  });
})